package com.eastcompeace.controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class SubcriberTestService {
	private final static Logger logger = LogManager.getLogger(SubcriberTestService.class);

	/**
	 * @param deveEui
	 *            schema account content jsonData
	 * @return
	 */
	@PostMapping("/testMessage")
	@ResponseBody
	public String handleMessage(HttpServletRequest request, @RequestBody String jsonData) {
		// jsonData传输参数
		String header = request.getHeader("subscribeType");
		String header2 = request.getHeader("code");
		//
		// try {
		// Thread.sleep(1000);
		// } catch (InterruptedException e) {
		// logger.error(e, e);
		// }

		logger.debug("subscribeType=" + header + "   code:" + header2 + "   jsonData:" + jsonData);

		return "";

	}
}
